package hotciv.factories;

import java.util.HashMap;

import hotciv.common.CommonTileMap;
import hotciv.common.TrueRandomImpl;
import hotciv.framework.BattleStrategy;
import hotciv.framework.City;
import hotciv.framework.Position;
import hotciv.framework.Randomizer;
import hotciv.framework.TileMap;
import hotciv.framework.Unit;
import hotciv.framework.WinnerStrategy;
import hotciv.variants.EpsilonBattleStrategy;
import hotciv.variants.EpsilonWinner;

public class EpsilonCivFactory extends AlphaCivFactory {
	private Randomizer dice1;
	private Randomizer dice2;
	private TileMap tileMap;
	
	public EpsilonCivFactory() {
		super();
		dice1 = new TrueRandomImpl();
		dice2 = new TrueRandomImpl();
	}
	
	public EpsilonCivFactory(TileMap tileMap, HashMap<Position,Unit> unitMap, HashMap<Position, City> cityMap) {
		this();
		this.tileMap = tileMap;
		this.unitMap = unitMap;
		this.cityMap = cityMap;
	}
	
	public void setRandomizers(Randomizer d1, Randomizer d2) {
		dice1 = d1;
		dice2 = d2;
	}
	
	@Override
	public TileMap tileMap() {
		if (tileMap==null) return new CommonTileMap();
		else return tileMap;
	}
	
	@Override
	public WinnerStrategy winnerStrategy() {
		return new EpsilonWinner();
	}
	
	@Override
	public BattleStrategy battleStrategy() {
		return new EpsilonBattleStrategy(dice1, dice2);
	}
}
